import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
//登陆页
const Login = r => require.ensure([], () => r(require('pages/login/login.vue')), 'login')
//首页
const Home = r => require.ensure([], () => r(require('pages/home/list.vue')), 'home')
const Homemain = r => require.ensure([], () => r(require('pages/home/homemain.vue')), 'Homemain')
//管理员
const Admin = r => require.ensure([], () => r(require('pages/systemManage/admin/list.vue')), 'admin')
//角色
const Role = r => require.ensure([], () => r(require('pages/systemManage/role/list.vue')), 'role')
//日志
const Log = r => require.ensure([], () => r(require('pages/systemManage/log/list.vue')), 'log')
//字典表
const Dictionary = r => require.ensure([], () => r(require('pages/dictionary/dictionary/list.vue')), 'dictionary')
//自定义图文
const Information = r => require.ensure([], () => r(require('pages/operationsManage/information/list.vue')), 'information')
//banner管理
const Banner = r => require.ensure([], () => r(require('pages/operationsManage/banner/list.vue')), 'banner')
//渠道商管理
const Channel = r => require.ensure([], () => r(require('pages/channelManage/channel/list.vue')), 'channel')
//核销员管理
const Writeoff = r => require.ensure([], () => r(require('pages/channelManage/writeoff/list.vue')), 'writeoff')
//分销商
const Distributor = r => require.ensure([], () => r(require('pages/distribution/distributor/list.vue')), 'distributor')
//分销设置
const Distributorsconfig = r => require.ensure([], () => r(require('pages/distribution/distributorsconfig/list.vue')), 'distributorsconfig')
//用户管理
const User = r => require.ensure([], () => r(require('pages/userManage/user/list.vue')), 'user')
//商品分类管理
const CardsTypes = r => require.ensure([], () => r(require('pages/productsManage/cardsTypes/list.vue')), 'cardsTypes')
//卡券管理
const Cards = r => require.ensure([], () => r(require('pages/productsManage/cards/list.vue')), 'cards')
//卡券订单
const CardsOrder = r => require.ensure([], () => r(require('pages/order/cardsOrder/list.vue')), 'cardsOrder')
//退款管理
const Refundlist = r => require.ensure([], () => r(require('pages/order/refundlist/list.vue')), 'refundlist')
//核销记录
const WriteoffRec = r => require.ensure([], () => r(require('pages/order/writeoffRec/list.vue')), 'writeoffRec')
//余额提现
const Distributiondeal = r => require.ensure([], () => r(require('pages/distribution/distributiondeal/list.vue')), 'distributiondeal')
//佣金审核
const Shopdistributorsaudit = r => require.ensure([], () => r(require('pages/distribution/shopdistributorsaudit/list.vue')), 'shopdistributorsaudit')
//销售日报
const DayPaper = r => require.ensure([], () => r(require('pages/count/dayPaper/list.vue')), 'dayPaper')
//销售月报
const MonthPaper = r => require.ensure([], () => r(require('pages/count/monthPaper/list.vue')), 'monthPaper')
//渠道商抽成统计
const ChannelCount = r => require.ensure([], () => r(require('pages/count/channelCount/list.vue')), 'channelCount')
export default new Router({
	routes: [{
			path: '/',
			component: Login,
		},
		{
			path: '/home',
			component: Home,
			children: [{
					path: "/interface/homemain",
					component: Homemain
				},
				{
					path: "/interface/admin",
					component: Admin
				},
				{
					path: "/interface/role",
					component: Role
				},
				{
					path: "/interface/log",
					component: Log
				},
				{
					path: "/interface/dictionary/list",
					component: Dictionary
				},
				{
					path: "/interface/information/list",
					component: Information
				},
				{
					path: "/interface/banner/list",
					component: Banner
				},
				{
					path: "/interface/channel/list",
					component: Channel
				},
				{
					path: "/interface/writeoff/list",
					component: Writeoff
				},
				{
					path: "/interface/dis/list",
					component: Distributor
				},
				{
					path: "/interface/dis/view",
					component: Distributorsconfig
				},
				{
					path: "/interface/user/list",
					component: User
				},
				{
					path: "/interface/goodstype/list",
					component: CardsTypes
				},
				{
					path: "/interface/goods/list",
					component: Cards
				},
				{
					path: "/interface/order/list",
					component: CardsOrder
				},
				{
					path: "/interface/orderpays/list",
					component: Refundlist
				},
				{
					path: "/interface/cards/list",
					component: WriteoffRec
				},
				{
					path: "/inteface/diswithdrawl/list",
					component: Distributiondeal
				},
				{
					path: "/interface/shopaudit/list",
					component: Shopdistributorsaudit
				},
				{
					path: "/interface/count/dayPaper",
					component: DayPaper
				},
				{
					path: "/interface/count/monthPaper",
					component: MonthPaper
				},
				{
					path: "/interface/channelCount/list",
					component: ChannelCount
				},
			]
		}
	]
})